package com.mdd.admin.controller.course;

import com.mdd.admin.config.aop.Log;
import com.mdd.admin.service.course.ICourseService;
import com.mdd.admin.validate.common.PageParam;
import com.mdd.admin.validate.course.CourseColumnParam;
import com.mdd.admin.validate.course.CourseParam;
import com.mdd.admin.validate.course.StudyCourseParam;
import com.mdd.admin.vo.course.CourseColumnListVo;
import com.mdd.admin.vo.course.CourseDetailVo;
import com.mdd.admin.vo.course.CourseListVo;
import com.mdd.common.core.AjaxResult;
import com.mdd.common.core.PageResult;
import com.mdd.common.validator.annotation.IDMust;
import org.springframework.util.Assert;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 课程管理
 */
@RestController
@RequestMapping("/api/course/study")
public class CourseStudyController {

    @Resource
    ICourseService iCourseService;

    /**
     * 回收课程
     *
     * @param studyCourseParam 参数
     * @return Object
     */
    @Log(title = "回收课程")
    @PostMapping("/del")
    public Object del(@Validated(value = StudyCourseParam.delete.class) @RequestBody StudyCourseParam studyCourseParam) {
        iCourseService.delCourseStudy(studyCourseParam.getUserId(), studyCourseParam.getCourseId());
        return AjaxResult.success(true);
    }

}
